package CSIRPSystem;


/**
 * Generated from IDL interface "CSIRP".
 *
 * @author JacORB IDL compiler V 2.3.0, 17-Feb-2007
 * @version generated at 2013-5-20 22:07:19
 */

public abstract class CSIRPPOA
	extends org.omg.PortableServer.Servant
	implements org.omg.CORBA.portable.InvokeHandler, CSIRPSystem.CSIRPOperations
{
	static private final java.util.Hashtable m_opsHash = new java.util.Hashtable();
	static
	{
		m_opsHash.put ( "trigger_heartbeat", new java.lang.Integer(0));
		m_opsHash.put ( "get_cs_irp_versions", new java.lang.Integer(1));
		m_opsHash.put ( "set_heartbeat_period", new java.lang.Integer(2));
		m_opsHash.put ( "get_heartbeat_period", new java.lang.Integer(3));
		m_opsHash.put ( "get_cs_irp_notification_profile", new java.lang.Integer(4));
		m_opsHash.put ( "get_cs_irp_operations_profile", new java.lang.Integer(5));
	}
	private String[] ids = {"IDL:CSIRPSystem/CSIRP:1.0"};
	public CSIRPSystem.CSIRP _this()
	{
		return CSIRPSystem.CSIRPHelper.narrow(_this_object());
	}
	public CSIRPSystem.CSIRP _this(org.omg.CORBA.ORB orb)
	{
		return CSIRPSystem.CSIRPHelper.narrow(_this_object(orb));
	}
	public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream _input, org.omg.CORBA.portable.ResponseHandler handler)
		throws org.omg.CORBA.SystemException
	{
		org.omg.CORBA.portable.OutputStream _out = null;
		// do something
		// quick lookup of operation
		java.lang.Integer opsIndex = (java.lang.Integer)m_opsHash.get ( method );
		if ( null == opsIndex )
			throw new org.omg.CORBA.BAD_OPERATION(method + " not found");
		switch ( opsIndex.intValue() )
		{
			case 0: // trigger_heartbeat
			{
			try
			{
				java.lang.String _arg0=_input.read_string();
				_out = handler.createReply();
				CSIRPConstDefs.ResultHelper.write(_out,trigger_heartbeat(_arg0));
			}
			catch(CSIRPSystem.InvalidManagerIdentifier _ex0)
			{
				_out = handler.createExceptionReply();
				CSIRPSystem.InvalidManagerIdentifierHelper.write(_out, _ex0);
			}
			catch(CSIRPSystem.TriggerHeartbeat _ex1)
			{
				_out = handler.createExceptionReply();
				CSIRPSystem.TriggerHeartbeatHelper.write(_out, _ex1);
			}
				break;
			}
			case 1: // get_cs_irp_versions
			{
			try
			{
				_out = handler.createReply();
				ManagedGenericIRPConstDefs.VersionNumberSetHelper.write(_out,get_cs_irp_versions());
			}
			catch(CSIRPSystem.GetCSIRPVersions _ex0)
			{
				_out = handler.createExceptionReply();
				CSIRPSystem.GetCSIRPVersionsHelper.write(_out, _ex0);
			}
				break;
			}
			case 2: // set_heartbeat_period
			{
			try
			{
				short _arg0=_input.read_ushort();
				_out = handler.createReply();
				CSIRPConstDefs.ResultHelper.write(_out,set_heartbeat_period(_arg0));
			}
			catch(CSIRPSystem.InvalidHeartbeatPeriod _ex0)
			{
				_out = handler.createExceptionReply();
				CSIRPSystem.InvalidHeartbeatPeriodHelper.write(_out, _ex0);
			}
			catch(CSIRPSystem.ConflictingHeartbeatPeriod _ex1)
			{
				_out = handler.createExceptionReply();
				CSIRPSystem.ConflictingHeartbeatPeriodHelper.write(_out, _ex1);
			}
			catch(ManagedGenericIRPSystem.OperationNotSupported _ex2)
			{
				_out = handler.createExceptionReply();
				ManagedGenericIRPSystem.OperationNotSupportedHelper.write(_out, _ex2);
			}
			catch(ManagedGenericIRPSystem.ValueNotSupported _ex3)
			{
				_out = handler.createExceptionReply();
				ManagedGenericIRPSystem.ValueNotSupportedHelper.write(_out, _ex3);
			}
			catch(CSIRPSystem.SetHeartbeatPeriod _ex4)
			{
				_out = handler.createExceptionReply();
				CSIRPSystem.SetHeartbeatPeriodHelper.write(_out, _ex4);
			}
				break;
			}
			case 3: // get_heartbeat_period
			{
			try
			{
				org.omg.CORBA.ShortHolder _arg0= new org.omg.CORBA.ShortHolder();
				_out = handler.createReply();
				CSIRPConstDefs.ResultHelper.write(_out,get_heartbeat_period(_arg0));
				_out.write_ushort(_arg0.value);
			}
			catch(CSIRPSystem.GetHeartbeatPeriod _ex0)
			{
				_out = handler.createExceptionReply();
				CSIRPSystem.GetHeartbeatPeriodHelper.write(_out, _ex0);
			}
				break;
			}
			case 4: // get_cs_irp_notification_profile
			{
			try
			{
				java.lang.String _arg0=_input.read_string();
				_out = handler.createReply();
				ManagedGenericIRPConstDefs.MethodListHelper.write(_out,get_cs_irp_notification_profile(_arg0));
			}
			catch(ManagedGenericIRPSystem.InvalidParameter _ex0)
			{
				_out = handler.createExceptionReply();
				ManagedGenericIRPSystem.InvalidParameterHelper.write(_out, _ex0);
			}
			catch(ManagedGenericIRPSystem.OperationNotSupported _ex1)
			{
				_out = handler.createExceptionReply();
				ManagedGenericIRPSystem.OperationNotSupportedHelper.write(_out, _ex1);
			}
			catch(CSIRPSystem.GetCSIRPNotificationProfile _ex2)
			{
				_out = handler.createExceptionReply();
				CSIRPSystem.GetCSIRPNotificationProfileHelper.write(_out, _ex2);
			}
				break;
			}
			case 5: // get_cs_irp_operations_profile
			{
			try
			{
				java.lang.String _arg0=_input.read_string();
				_out = handler.createReply();
				ManagedGenericIRPConstDefs.MethodListHelper.write(_out,get_cs_irp_operations_profile(_arg0));
			}
			catch(ManagedGenericIRPSystem.InvalidParameter _ex0)
			{
				_out = handler.createExceptionReply();
				ManagedGenericIRPSystem.InvalidParameterHelper.write(_out, _ex0);
			}
			catch(ManagedGenericIRPSystem.OperationNotSupported _ex1)
			{
				_out = handler.createExceptionReply();
				ManagedGenericIRPSystem.OperationNotSupportedHelper.write(_out, _ex1);
			}
			catch(CSIRPSystem.GetCSIRPOperationsProfile _ex2)
			{
				_out = handler.createExceptionReply();
				CSIRPSystem.GetCSIRPOperationsProfileHelper.write(_out, _ex2);
			}
				break;
			}
		}
		return _out;
	}

	public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] obj_id)
	{
		return ids;
	}
}
